package com.duowan.realtime.dao.redis;

import com.duowan.common.redis.RedisDaoSupport;
import com.duowan.common.redis.RedisTransactionCallback;
import redis.clients.jedis.Transaction;

import java.util.List;

/**
 * @author tangsicheng
 * @version 1.0
 * @since 1.0
 */
public class RedisDao extends RedisDaoSupport {
    public List<String> multiGet(final List<String> keys) {
        return (List<String>) getRedisTemplate().execute(new RedisTransactionCallback<Object>() {
            public Object doInTransaction(Transaction tran) {
                for (String key : keys) {
                    tran.get(key);
                }
                return tran.exec();
            }
        });
    }
}